#ifndef DARV_EVENTLISTENER_HPP
#define DARV_EVENTLISTENER_HPP

#define OIS_DYNAMIC_LIB
#include <OIS.h>
#include <Ogre.h>

#include <iostream>

namespace DARV {

class EventListener : public OIS::KeyListener, public OIS::MouseListener
{
public:

	EventListener(Ogre::RenderWindow* win, Ogre::Camera* cam);
	~EventListener();
	
	bool process(void);
	
	/* Méthodes virtuelles héritées de OIS::KeyListener */
	bool keyPressed(const OIS::KeyEvent &e);
	bool keyReleased(const OIS::KeyEvent &e);

	/* Méthodes virtuelles héritées de OIS::MouseyListener */
	bool mouseMoved(const OIS::MouseEvent &arg);
	bool mousePressed(const OIS::MouseEvent &arg, OIS::MouseButtonID id);
	bool mouseReleased(const OIS::MouseEvent &arg, OIS::MouseButtonID id);

private:

	void initOIS(void);
	void closeOIS(void);

public:

	Ogre::RenderWindow* mWindow;
	Ogre::Camera* mCamera;

	OIS::InputManager *mInputManager;
	OIS::Keyboard *mKeyboard;
	OIS::Mouse *mMouse;
	int mouseX, mouseY;

	bool moveUp;
	bool moveDown;
	bool moveLeft;
	bool moveRight;

};

}

#endif
